<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/reset.css">
    <link rel="stylesheet" href="../css/common.css">
    <style>
        .header {
            height: 100px;
            background-color: #eee;
        }

        .header li {
            float: left;
            margin: 0 40px;
            line-height: 97px;

            /* 参照物 */
            position: relative;
        }

        .header li a {
            display: block;
        }

        .header li:hover {
            border-bottom: 3px solid green;
            color: green;
        }

        .hide {

            /* 
                1 画色块    width / height
                2 定位     absolute   还要记得给参照物
                3 给位置   left / right / top / bottom
                4 隐藏     height:0;overflow:hidden;transition:1s

                5 摸   摸谁？   父元素:hover .hide {height:200px}
             */


            width: 100px;
            height: 200px;
            background-color: #ff0;

            position: absolute;
            top: 100px;

            /* 当子元素超过了父元素大小的时候，居中无效 */
            /* left: 0;
            right: 0;
            margin: auto; */

            left: 50%;
            transform: translate(-50%, 0);


            height: 0;
            overflow: hidden;
            transition: 1s;
        }

        .header li:hover .hide {
            height: 200px;
        }
    </style>
</head>

<body>
    <div class="header">
        <div class="w">
            <ul>
                <li>
                    <a href="">shou ye</a>
                    <div class="hide"></div>
                </li>
                <li>
                    <a href="">shou ye</a>
                    <div class="hide"></div>
                </li>
                <li>
                    <a href="">shou ye</a>
                    <div class="hide"></div>
                </li>
                <li>
                    <a href="">shou ye</a>
                </li>
                <li>
                    <a href="">shou ye</a>
                </li>
            </ul>
        </div>
    </div>
</body>

</html>